package com.cn.yang.service.impl;


import com.cn.yang.dao.MainPageDao;
import com.cn.yang.dao.impl.MainPageDaoImpl;
import com.cn.yang.model.mainPage.HeadAndFootModel;
import com.cn.yang.model.mainPage.HeadLinkModel;
import com.cn.yang.model.mainPage.MainPageModel;
import com.cn.yang.service.MainPageService;

import java.util.List;

public class MainPageServiceImpl implements MainPageService {

    //头和尾的一些Model的查找和更新
    @Override
    public HeadAndFootModel selectHeadFoot() {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.selectHeadFoot();
    }

    @Override
    public int updataHeadFoot(HeadAndFootModel model) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.updataHeadFoot(model);
    }
//尾部的=========================================================
    @Override
    public List<HeadLinkModel> selectHeadLink() {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.selectHeadLink();
    }
    @Override
    public int addHeadLink(HeadLinkModel model) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.addHeadLink(model);
    }

    @Override
    public HeadLinkModel selectHeadLinkById(Integer id) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.selectHeadLinkById(id);
    }

    @Override
    public int updateById(HeadLinkModel model) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.updateById(model);
    }

    @Override
    public int deleteHeadLink(String id) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.deleteHeadLink(id);
    }
//主页 分 model
    @Override
    public List<MainPageModel> findMainPage(MainPageModel model) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.findMainPage(model);
    }

    @Override
    public int countMainPage() {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.countMainPage();
    }

    @Override
    public MainPageModel selectById(Integer id) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.selectById(id);
    }

    @Override
    public int updateMainPage(MainPageModel model) {
        MainPageDao dao = new MainPageDaoImpl();
        return dao.updateMainPage(model);
    }
}
